package com.tiny.work.btrace.map;

import com.sun.btrace.BTraceUtils;
import com.sun.btrace.annotations.*;

import java.lang.reflect.Field;

import static com.sun.btrace.BTraceUtils.Reflective.get;
import static com.sun.btrace.BTraceUtils.*;

@BTrace
public class TraceMap {
    @OnMethod(
            clazz = "com.fangdd.customer.service.impl.MapServiceImpl",
            method = "getMapInfo",
            location = @Location(value = Kind.RETURN)
    )
    public static void gcExecute(@Return Object result){

        Field levelFiled = field("com.fangdd.customer.entity.business.map.MapResponse","level");
        Field pointListFiled = field("com.fangdd.customer.entity.business.map.MapResponse","pointList");
        int level = (Integer) get(levelFiled, result);
        println(BTraceUtils.Strings.strcat("level:", str(level)));
        Object o = get(pointListFiled, result);
        println(o);

    }
}
